﻿<UserControl x:Class="ViCode_LeVi.Controls.VMTabRiskManagement"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
    xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
        xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
        xmlns:Data="clr-namespace:ViCode_LeVi.Data"
        xmlns:chart="clr-namespace:ViCode_LeVi.Controls.Charts">
    <vmcontrol:VMRootControl>
        <TabControl Name="TabControl_Main">
            <TabItem Header="Management">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid Grid.Column="0" Grid.Row="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <ListView Name="ListView_TaskItems" Grid.Column="1" Grid.Row="0" 
                              SelectedItem="{Binding IM_Current_Task}"
                                ItemsSource="{Binding Tasks_Source}"
                              SelectionMode="Single">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn  DisplayMemberBinding="{Binding RiskNo}">
                                        <GridViewColumn.Header>
                                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="RiskManagementItem_RiskNo_Text"/>
                                        </GridViewColumn.Header>
                                    </GridViewColumn>
                                    <GridViewColumn DisplayMemberBinding="{Binding Risk}">
                                        <GridViewColumn.Header>
                                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="RiskManagementItem_Risk_Text"/>
                                        </GridViewColumn.Header>
                                    </GridViewColumn>
                                    <GridViewColumn DisplayMemberBinding="{Binding ImpactName}">
                                        <GridViewColumn.Header>
                                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="RiskManagementItem_Impact_Text"/>
                                        </GridViewColumn.Header>
                                    </GridViewColumn>
                                    <GridViewColumn DisplayMemberBinding="{Binding ProbabilityName}">
                                        <GridViewColumn.Header>
                                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="RiskManagementItem_Probability_Text"/>
                                        </GridViewColumn.Header>
                                    </GridViewColumn>
                                    <!--<GridViewColumn >
                                <GridViewColumn.Header>
                                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_IsActive_Text"/>
                                </GridViewColumn.Header>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding Active}"      VerticalAlignment="Center"  />
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>-->
                                    <GridViewColumn x:Name="GridViewColumn_Manage">
                                        <GridViewColumn.Header>
                                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="RiskManagementItem_Manage_Text"/>
                                        </GridViewColumn.Header>
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <vmcontrol:VMTextBlockNoWrap TextWrapping="NoWrap" TextTrimming="WordEllipsis" Text="{Binding Manage}"      VerticalAlignment="Center"  />
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>

                                </GridView>
                            </ListView.View>
                        </ListView>

                        <StackPanel Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
                            <Button Name="Button_AddNew" Content="Add" Margin="2"/>
                            <Button Name="Button_Remove" Content="Delete" Margin="2"/>
                        </StackPanel>


                        <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="RiskManagementItem_Risk_Text" Margin="2"/>
                        <vmcontrol:VMTextBox DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Risk}" Margin="2"/>
                        <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="RiskManagementItem_Impact_Text" Margin="2"/>
                        <vmcontrol:VMComboBox_Impact DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}" Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" SelectedValue="{Binding Impact}" Margin="2"/>
                        <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="RiskManagementItem_Probability_Text" Margin="2"/>
                        <vmcontrol:VMComboBox_Probability DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}" Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Stretch" SelectedValue="{Binding Probability}" Margin="2"/>

                        <!--<vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_IsActive_Text" Margin="2"/>
                <CheckBox DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}" Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" IsChecked="{Binding Active}" Margin="2"/>-->

                        <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="RiskManagementItem_Manage_Text" Margin="2"/>
                        <vmcontrol:VMTextBox_MultiLine DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}"  Grid.Column="1" Grid.Row="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Manage}" MinLines="6"  Margin="2"/>
                    </Grid>
                    <Button Content="Print" Click="Button_Click" Grid.Row="1" MinWidth="100" HorizontalAlignment="Right"/>
                </Grid>
            </TabItem>
            <TabItem Name="TabItem_Chart" Header="Chart">
                <WindowsFormsHost>
                    <chart:RiskChart x:Name="RiskChart"/>
                </WindowsFormsHost>
            </TabItem>
        </TabControl>
    </vmcontrol:VMRootControl>
</UserControl>
